import Vue from '@/main.js';






export  function updateRole(id, roleName, description, menuList, halfMenuList) {
  var path = "/auth/role/updateRoleInfo";
  return Vue.$http.post(path, {
      id:id,
      name: roleName,
      description: description,
      menuList: menuList,
      halfMenuList: halfMenuList
    })
    .then((res) => {
        return res;
    })
    .catch(function (error) {
      console.log(error);
    });
}





export  function getRoleInfoById(id) {
  var path = "/auth/role/getRoleDetail?id="+id;
  return Vue.$http.get(path)
    .then((res) => {
        return res.data.data;
    })
    .catch(function (error) {
      console.log(error);
    });
}

export  function deleteRole(id) {
  var path = "/auth/role/deleteRoleOnLogic?id="+id;
  return Vue.$http.get(path)
    .then((res) => {
        return res.data;
    })
    .catch(function (error) {
      console.log(error);
    });
}